# 01-01

puts 'Hello, world.'

# 01-02

'Hello, Ruby,'.index 'Ruby'

# 01-03

name = 'someone'
10.times do puts name end

# 01-04

(1..10).each do |num| puts "This is sentence number #{num}," end

# 01-05

# ruby exercises.rb

# 01-06

puts 'Enter lower limit:'
lower_limit = gets.to_i
puts 'Enter upper limit:'
upper_limit = gets.to_i
hidden_number = rand(lower_limit..upper_limit)

puts "Guess a number between #{lower_limit} and #{upper_limit}."
def ask
  puts 'What is your guess?'
  gets.to_i
end

guessed = ask
while guessed != hidden_number do
  if guessed > hidden_number
    puts 'Your number is too high.'
  else
    puts 'Your number is too low.'
  end
  guessed = ask
end
puts 'Your number is correct.'
puts 'You win!'
